import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/spend',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/spend/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/spend',
    method: 'put',
    data
  })
}

export function getData() {
  return request({
    url: 'api/spend/getData',
    method: 'get'
  })
}

export function everyMonthNum(data) {
  return request({
    url: 'api/spend/everyMonth/' + data,
    method: 'get'

  })
}

export function getSpendTypeNum(data) {
  return request({
    url: 'api/spend/getSpendTypeNum/' + data,
    method: 'get'
  })
}

export function getPayTypeNum(data) {
  return request({
    url: 'api/spend/getPayTypeNum/' + data,
    method: 'get'
  })
}

export function monthDateList(data) {
  return request({
    url: 'api/spend/monthDateList/' + data,
    method: 'get'
  })
}

export function getSpendLabel() {
  return request({
    url: 'api/spend/getSpendLabel',
    method: 'get'
  })
}

export default { add, edit, del, everyMonthNum, getData, getSpendTypeNum, getPayTypeNum, monthDateList, getSpendLabel }
